function validateFields() {
	var lastName = document.getElementById("lastName");
	var firstName = document.getElementById("firstName");
	var homeNumber = document.getElementById("homeNumber");
	var cellNumber = document.getElementById("cellNumber");
	var email = document.getElementById("email");
	
	if (firstName.value == "" || firstName.value.length > 45) {
		var alertFirstName=document.getElementById("alertFirstName");
			alert(alertFirstName.value);
		document.getElementById("firstName").focus();
		return false;
	}
	if (lastName.value == "" || lastName.value.length > 45) {
		var alertLastName=document.getElementById("alertLastName");
		alert(alertLastName.value);
		document.getElementById("lastName").focus();
		return false;
	}
	
	if (homeNumber.value.length != 13 && homeNumber.value.length != 0) {
		var checkHN=document.getElementById("alertHomeNr");
		alert(checkHN.value);
		document.getElementById("homeNumber").focus();
		return false;
	}

	if (cellNumber.value == "") {
		var alertCell=document.getElementById("alertEnterCellNr");
		alert(alertCell.value);
		document.getElementById("cellNumber").focus();
		return false;
	}
	

	var reCell = /^(0040|0049)\d{9}/;
	if (reCell.test(cellNumber.value) == false) {
		var alertCell=document.getElementById("alertCheckCellNr");
		alert(alertCell.value);
		document.getElementById("cellNumber").focus();
		return false;
	}

	if (email.value == "" || email.value.length > 45) {
		var alertMail=document.getElementById("alertInsertEmail");
		alert(alertMail.value);
		document.getElementById("email").focus();
		return false;
	}

	var reEmail = /^[a-zA-Z]+[a-zA-Z.+_0-9]+@msg-systems.com/;
	if (reEmail.test(email.value) == false) {
		var alertMail=document.getElementById("alertCheckEmail");
		alert(alertMail.value);
		document.getElementById("email").focus();
		return false;
	}

	return true;
}

function clearFields() {
	document.getElementById("firstName").value="";
	document.getElementById("lastName").value="";
	document.getElementById("cellNumber").value="";
	document.getElementById("homeNumber").value="";
	document.getElementById("email").value="";
	document.getElementById("rank").value="";
	document.getElementById("description").value="";

}
